# UVC 1.1 参数设置工具 Makefile

# 编译器设置
CC = gcc
CFLAGS = -Wall -Werror -g
LDFLAGS = -lv4l2

# 目标程序
TARGETS = uvc_set uvc_set_v1.1

# 编译规则
all: $(TARGETS)

uvc_set: uvc_set.c
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

uvc_set_v1.1: uvc_set_v1.1.c
	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)

# 清理编译生成的文件
clean:
	rm -f $(TARGETS) *.o a.out

# 安装程序
install:
	install -m 755 $(TARGETS) /usr/local/bin/

# 显示帮助信息
help:
	@echo "使用方法: make [目标]"
	@echo "  all: 编译所有程序 (默认)"
	@echo "  uvc_set: 编译基本版UVC设置程序"
	@echo "  uvc_set_v1.1: 编译增强版UVC设置程序"
	@echo "  clean: 清理编译生成的文件"
	@echo "  install: 安装程序到系统 (需要root权限)"
	@echo "  help: 显示本帮助信息"

# 声明伪目标
.PHONY: all clean install help